Waveform generation

ABSTRACT

A waveform generator for generating a smooth version of an original waveform which contains abrupt transitions, includes a phase accumulator incremented at successive sampling times to produce an output representative of the phase of the original waveform, a phase scaler arranged to convert the residual contents of the accumulator following a transition from phase to time, computing means responsive to the time to calculate a number of samples along a smooth transition, each offset by that time from the sampling times, and a sequencer to replace the otherwise abrupt transition with the sequence of samples from the computed smooth transition.

The present invention relates to a method and apparatus for generatingan improved waveform, and in particular a waveform containing abrupttransitions.

In digital and electronic systems there is often a requirement togenerate an analogue waveform from a number of discrete digital samples.This is generally accomplished by using a sample generator of somedescription to produce a stream of discrete samples at fixed timeintervals representing the desired waveform and to input the generatedsamples to a digital-to-analogue converter (DAC), generally referred toas Direct Digital Synthesis (DDS).

However, certain waveforms are more difficult to produce using thisscheme than others. For example, it is relatively difficult to producean accurate analogue square wave signal from a sampled system because asimple square wave requires an infinite bandwidth to be represented. Ifthe period of the square wave required is not an integer number ofsamples, the sampled system must approximate the square wave by placingoutput edges of the waveform on the next available sample. This meansthat the output edge can be up to one sample time late, the net effectbeing that the output edge will move back and forth over one sampletime. The movement of the output edge is referred to as edge jitter.Such edge jitter is usually not acceptable.

One possible solution to this problem is to use the sample generator togenerate a sine wave, which when anti-alias filtered can provideaccurate zero crossings. A comparator is then used to create the squarewave, with the zero crossings causing an output edge to be generated.However, additional circuitry is required to provide the comparator andnecessary two reference voltage generators in addition to control andcalibration circuitry. This increases the complexity and expense of therequired circuitry. Furthermore, in certain electronic applications theadditional circuitry required cannot be physically fitted within theavailable space, whether this is in terms of discrete components orintegrated circuit silicon wafer construction.

Another solution is to vary the frequency of the sample clock so that itis an exact multiple of the edge repetition rate. Varying the sampleclock frequency is often not an option when the same clock is used togenerate multiple independent sources, as is frequently the case.Another solution is to use a sample clock frequency much greater thanthe edge repetition rate, for instance 1000 times greater. Again, thispossible solution has its own shortcomings. Using a very high sampleclock frequency is generally too expensive.

According to a first aspect of the present invention there is provided awaveform generator for generating a data stream comprising a pluralityof data values at predetermined sample times, the data stream beingrepresentative of a smooth version of an original waveform, the originalwaveform including at least one abrupt transition, the waveformgenerator comprising a phase accumulator arranged to provide an outputrepresentative of the phase of the original waveform, the accumulatoroutput being sequentially incremented by a predetermined value atsuccessive sample times, a transition detector arranged to receive theaccumulator output and to provide an output signal when the accumulatoroutput is at least equal to a value representative of the phase of theoriginal waveform at the point of an abrupt transition, a phase scalerarranged, in response to receiving the output signal from the transitiondetector, to determine from the accumulator output the phase differencebetween the phase represented by the accumulator output and the phase ofthe original waveform at the point of the abrupt transition and toconvert the phase difference to a time value, a data processor arrangedto generate a sequence of data values representative of a smoothtransition offset by the time value from the sample times and asequencer arranged to insert the sequence of data values into thedatastream.

Preferably, the data processor is arranged to calculate the sequence ofdata values representative of the smooth transition in accordance withthe time value output from the phase scaler.

Alternatively, the waveform generator may further comprise a datastorage device having a plurality of predetermined sequences of datavalues, each predetermined sequence being representative of a smoothtransition being offset by a particular value of the time value outputfrom the phase scaler, the data processor being arranged to select thepredetermined sequence of data values corresponding to a particular timevalue that is closest in value to the time value output from the phasescaler.

Additionally or alternatively, the waveform generator may furthercomprise an offset generator arranged to receive the output from thephase accumulator, to sum the output value with a predetermined offsetvalue and to provide the product of the summation to the transitiondetector, wherein the transition detector provides a further outputsignal representative of a further abrupt transition.

Preferably, the predetermined increment value is variable, therebyallowing the frequency of the generated waveform to be varied.

Preferably, the smooth transition substantially corresponds to agaussian pulse response convolved with a square wave.

According to a second aspect of the present invention there is provideda method of generating a waveform, the waveform comprising a pluralityof data values at predetermined sample times, the waveform being asmooth representation of an original waveform, the original waveformincluding at least one abrupt transition, the method comprisingincrementing a phase accumulator by a predetermined value thatsuccessive sample times and providing an output from the phaseaccumulator, the output being representative of the phase of theoriginal waveform, determining when the accumulator output is at leastequal to a value representative of the phase of the original waveform atthe point of an abrupt transition, determining from the accumulatoroutput at the point of an abrupt transition the difference between thephase represented by the accumulator output and the phase of theoriginal waveform at the point of the abrupt transition and convertingthe phase difference to an offset time value, generating a sequence ofdata values representative of a smooth transition offset by theconverted time value from the sample times and inserting the generatedsequence of data values into the plurality of data values comprising thegenerated waveforms.

The sequence of data values representative of the smooth transition maybe calculated mathematically in accordance with the offset time value,or alternatively may be selected from a plurality of stored sequences.

Additionally or alternatively, an offset value may be summed with theoutput of the phase accumulator and a determination made when the summedproduct is at least equal to a value representative of the phase of theoriginal waveform at the point of a further abrupt transition.

Preferably, the smooth transition corresponds substantially to agaussian pulse response convolved with a square wave. The value by whichthe phase accumulator is incremented may also be variable.

According to a third aspect of the present invention is a provided awaveform generator for generating a sequence of data values atpredetermined time intervals, the sequence of data values beingrepresentative of a smooth version of an original waveform, the originalwaveform comprising periods of constant amplitudes separated by abrupttransitions, the waveform generator comprising a phase accumulatorarranged to provide an accumulator output the value of which isincremented by a predetermined value at each predetermined timeinterval. The accumulator output being representative of the phase ofthe original waveform, a phase mapper arranged to receive theaccumulated output and to generate a modified phase output in accordancewith the received accumulator output, and an output generator arrangedto output a data value of said sequence of data values in accordancewith the modified phase output received from the phase mapper.

The output generator preferably comprises a look-up table having aplurality of predetermined data values each corresponding to a modifiedphase output value.

Additionally, the phase mapper may generate a constant modified phaseoutput when the accumulator output is representative of a period of theoriginal waveform having a constant amplitude and wherein said constantmodified phase output corresponds to a single data value in the look-uptable.

Additionally or alternatively, the phase mapper may further comprisecomparator means for comparing the accumulator output with one or morepredetermined threshold values, the or each threshold value defining theboundary between said periods of constant amplitude in the originalwaveform.

According to a fourth aspect of the present invention there is provideda method of generating a sequence of data values at predetermined timeintervals, the sequence of data values being representative of a smoothversion of an original waveform, the original waveform comprisingperiods of constant amplitude separated by abrupt transitions, themethod comprising incrementing a phase accumulator by a predeterminedvalue at successive time intervals and providing an accumulator outputthat is representative of the phase of the original waveform, modifyingthe accumulator output as a function of the accumulator output togenerate a modified phase output and generating a data value comprisingone of the data values of the sequence of data values in accordance withthe modified phase output.

Preferably, the generated data value is derived from a look-up tablehaving a plurality of data values each corresponding to modified phaseoutput value.

Additionally, the modified phase output may be a constant value when theaccumulator output is representative of a period of the originalwaveform having a constant amplitude and the constant value correspondsto a single data value in the look-up table.

Additionally or alternatively, the method may further comprise comparingthe accumulator output with one or more predetermined threshold values,the or each threshold value corresponding to a boundary between theperiods of constant amplitude in the original waveform.

Embodiments of the present invention are described hereinafter, by wayof illustrative example only, with reference to the accompanyingfigures, of which:

FIG. 1 is a schematic illustration of a prior art accumulator;

FIG. 2 illustrates a number of typical count sequences of a prior artaccumulator;

FIG. 3 illustrates the effect of edge jitter in the time domain;

FIG. 4 illustrates the effect of edge jitter in the frequency domain;

FIG. 5 illustrates the origin of the error signal from a prior artsquare wave generator;

FIG. 6 shows a number of typical filtered transition waveforms accordingto an embodiment of the present invention;

FIG. 7 shows the relationship between an abrupt step, a gaussian pulse,and the filtered edge produced;

FIG. 8 is a schematic illustration of a waveform generator according toan embodiment of the present invention;

FIG. 9 is a schematic illustration of a waveform generator according toa first embodiment of the present invention;

FIG. 10 is a schematic illustration of a waveform generator according toa second embodiment of the present invention;

FIG. 11 is a schematic illustration of a waveform generator according toa third embodiment of the present invention;

FIG. 12 illustrates the relationship between accumulator phase, mappedphase, and output waveforms for an embodiment of the present invention;

FIG. 13 is a schematic illustration of a waveform generator according toa further embodiment of the present invention;

FIG. 14 is a schematic illustration of a waveform generator according toa further embodiment of the present invention;

FIG. 15 is a schematic illustration of a waveform generator according toanother embodiment of the present invention;

FIG. 16 illustrates the reduction in edge jitter in the time domain ofan embodiment of the present invention; and

FIG. 17 illustrates the reduction in edge jitter in the frequency domainof an embodiment of the present invention.

FIG. 1 shows the components of a prior art phase accumulator, which isused to keep track of the phase of the required underlying waveform. Thephase accumulator consists of a register 11 and an adder 12, theregister clocked by the system sampling clock 13. Each clock cycle, thevalue contained in the register is incremented by the value of the phaseincrement 15.

The accumulator may be built with any length word, but in practice it islong enough only to achieve sufficient frequency resolution for theintended application. For instance a 32 bit phase accumulator clocked at100 MHz has a resolution of 23 mHz. The value output by the accumulatoris an integer running from 0 to the size of the accumulator-1. However,the output can also usefully be interpreted as a fractional valuerunning from 0 to nearly 1, which represents the phase of the requiredwaveform in cycles, by dividing the output by the accumulator length.

The example shown uses a short 5 bit accumulator for illustrativeconvenience, rather than a practical length such as 32 bits. However,the extension to any length is obvious. This accumulator can contain anynumber from 0 to 31 inclusive. If an increment operation would take itscontents to 32 or above on the next cycle, the number is reduced modulo32 before being stored. In the practical binary accumulator, this isachieved by simply retaining only the bottom 5 bits, and ignoring higherweight bits from the adder, thus an adder output of 32 will be stored as0 for use in the next cycle.

The example shown is for a phase increment of 3. The value of thisincrement defines the frequency that will be reproduced. In this case,32 successive additions will produce 3 cycles of output, the frequencyis therefore 3/32nds of the sample rate. The value of the increment mayalso be regarded as a delta phase, as each addition advances the phaseof the accumulator by 3/32nds of a cycle. Other values of increment willproduce different frequencies. In particular, an increment of 1 willproduce the lowest frequency, which is also equal to the frequencyresolution of the phase accumulator.

Table 1 demonstrates the operation of the 5 bit accumulator. It tracksthe accumulator contents for three sequences around the point where theMSB changes sign. In the case of an increment of 3, these exhaust allthe possible paths through the transition. In general, with longeraccumulators and larger increments, there will be many more possiblesequences through any given region.

The three possible sequences for this example are tabulated in table 1,around the region at half a cycle, where the count changes from 15 to16, and the MSB goes from 0 to 1. TABLE 1 Sample number Sequence 11Sequence 12 Sequence 13 1 12 10 11 2 15 13 14 3 18 16 17 4 21 19 20

In all three sequences, the most significant bit changes sign followingsample number 2. The prior art square wave generator will thereforeoutput a transition at sample number 3, which is typically done byoutputting the MSB itself.

The phase of each sequence is graphed as a continuous curve in FIG. 2.The point where the transitions of the underlying ideal square waveoccurs is the point where the continuous phase crosses defined phasevalues. For a square wave, these values are conventionally phase=0cycles, and phase=0.5 cycles, which with a 32 count accumulatorcorrespond to counts of 0 and 16 respectively.

The point at which the continuous phase curve crosses the count of 16does not generally correspond to a sampling time. When the MSB changeoccurs in sequence 21 to the value 18, the underlying transition 24occurs ⅔rds of a cycle before the sample time. When the MSB changeoccurs in sequence 23 to 17, the underlying transition 25 occurs ⅓^(rd)of a cycle before the sample time. It is only when the MSB change occursto 16 in sequence 22 that the underlying transition 26 occurs at thesample time.

It can therefore be seen that it is impossible to output an abrupttransition at the correct time, which in general will be unrelated tothe predetermined sampling times, while being constrained to make outputchanges only at predefined sampling times.

The prior art square wave generator resolves this impossibility by notattempting to make transitions at the correct times, but byapproximating those times to the sampling times. Moving the output edgesaway from their correct times in this way introduces jitter. FIGS. 3 and4 show the effect of this jitter on measurements of the waveform.

FIG. 3 is an oscillograph, which is triggered on the rising edge of thewaveform. The source of the signal is a prior art square wave generatorfollowed by an analogue anti-alias filter. It can be seen that each halfcycle has been recorded as having two lengths rather than one. As eachtransition is constrained to occur at a sampling time, each half cyclecannot have the correct duration of N+0.3 sample times. The actuallength produced for each half cycle by the prior art generator is eitherN cycles or N+1 sampling times. The long term average phase andfrequency will remain correct, even though individual transitions sufferfrom jitter.

FIG. 4 shows the corresponding effect in the frequency domain. The largepeaks in the spectrum display correspond to the fundamental signal andthe first few harmonics that would be expected from a clean square wave.Between the main peaks is a forest of smaller peaks. The presence ofthese smaller peaks, which are undesired energy, can be explained eitherin the time domain or the frequency domain.

In the time domain, the movement of each edge away from where it shouldbe is equivalent to the addition of a difference waveform, as shown inFIG. 5. This waveform consists of a narrow error spike for mosttransitions. In the general case, the polarity and width of these pulsesare pseudo random, and so will have a dense, low level spectrum, whichis essentially unpredictable in detail. The desired square wave is shownas 51. Trace 52 is the clock waveform, and the result of delaying eachedge until the next clock pulse is trace 53, which can change state onlyat clock pulse times. A copy of the original waveform is shown as 54,this is shifted to provide the best match between itself and thewaveform that is actually output 53. Finally the difference between thebest match for the output waveform is shown as 55. It is the energy ofwaveform 55 that is minimised when determining the shift required forthe best match for waveform 54. It can be seen how small changes in thetiming of the original square waveform with respect to the clockwaveform can make individual pulses vanish or invert, rendering thedetailed effect of the error waveform more or less unpredictable.

In the frequency domain, the higher harmonics of the square wave, whichare implicitly present up to infinite frequency in the description ofthe underlying square wave, are aliased down to low frequency by thesampling process. In the general case the aliassed frequencies, whichare N times the fundamental frequency modulo the sampling frequency, arepseudo random. Again, the spectrum is essentially unpredictable indetail.

The solution of the invention is to make an alternative approximation.This is that the edges of the waveform cannot be abrupt, but are allowedto extend for the duration of several sampling times, i.e. the waveformis smooth. This then allows them to be reproduced in their correctpositions, even with the constraint that the DAC may make output changesonly at regular sampling times. A few members from such a family ofedges is shown in FIG. 6. The family is defined across a duration of onesample time. Transitions 61 and 63 represent the earliest and latestthat would be used, and transition 62 is a typical intermediatewaveform.

The curve used for the edge approximation may be the step response of arealisable filter, or may be a mathematical curve which cannot berealised as a real filter. For instance, a gaussian curve and a halfsine curve both have useful properties, but can only be expressedalgebraically, rather than generated by the operation of a finitefilter. The only constraints on the curve are that the edge must becompact in time, so as to provide a steep edge to approximate thetransition, and compact in frequency, to remove the high harmonics ofthe square wave.

The prototype waveform chosen for the approximation is the result ofconvolving a Gaussian pulse response with the square wave. A gaussiancurve is one of the best to use for compactness in both the time andfrequency domains. There are two parameters to choose when making thisapproximation to a square wave. The first is the overall width of thecurve, in this case 8 sample times has been chosen as a good compromise,which will give the resultant approximate square wave a transitionsequence 8 samples long. The second is the accuracy of the gaussianpulse itself, in this case it has been truncated at sigma=4, (i.e. itextends over a period equal to 8 times the Standard Deviation) again agood compromise. Other applications may use other values withcorresponding benefits in either the time or frequency domain. FIG. 7shows the effect of the convolution operation. One transition from theoriginal square wave is shown as 71, the gaussian pulse as 72, and theresulting filtered transition which results from their convolution as73.

A first embodiment of the invention is shown in FIG. 8. The phase of thedesired waveform is computed in a prior art phase accumulator 81, whichis incremented on each clock cycle by a phase increment 82.

Each transition on the MSB of the phase accumulator output 83, whichwould be the square wave output of a prior art square wave generator, isdetected by the transition detector 84. This signals the scaler 85 tooperate on the residual contents of the phase word 83 immediatelyfollowing the transition, by dividing it by the increment 82. The resultof this division 86 is the time difference between the theoreticaltransition of the underlying waveform, and the following discretesampling time which signals the transition. Referring back to FIG. 2, itcan be seen in sequence 11 that when the residue was 2, and the phaseincrement was 3, the point at which the accumulator contents crossed the‘16’ line was ⅔rds of a sample before the sampling time.

Following the edge occurrence being signalled, the calculation means 87must compute a series of points on the transition curve. Given an offsettime 86 from the divider, these points will be at times offset+N, wheretime is expressed in units of the sample time. N varies from 0 toNsteps−1, where Nsteps is the number of steps to be used for thetransitional waveform. It will be appreciated that the calculated pointsalways occur at a sample time but the value of the points varies, thenet result being that the overall curve is offset.

The samples from the calculation means are provided to a sequencer 88,together with the edge signal 89. The edge signal indicates therequirement for a transition, with its polarity indicating the directionthat the transition should occur in. Although the calculation means maynot finish its calculations until many samples after receiving the edgesignal, the sequencer is able to construct a delayed version of therequired waveform, by delaying all output samples by the same amount.This amount is chosen to be sufficient for the operation of the scaler,and for the completion of the sample calculations.

The waveform from the sequencer now has an edge which occurs aconsistent time after the theoretical edge would have occurred, ratherthan a delay time which varies due to being approximated to the nearestsample time as in the prior art. The length of this delay, the latencybetween the value reached in the phase accumulator and the output, is ofno consequence to the quality or form of the square wave signal. If theabsolute time of the output signal is of importance, then this delay,often called a pipeline delay, can be managed by advancing the phase ofthe phase accumulator by the known amount of the delay.

It will be apparent that the square wave is a special case ofrectangular waveforms, having a duty cycle of 50%. It is often requiredto generate waveforms with other duty cycles, which may have their ownspecial applications. A waveform with a 33% duty cycle has no 3^(rd)harmonic, a waveform with 20% or 40% duty cycle has no 5^(th) harmonic.A waveform with a very small duty cycle approximates to a pulse, and hasa relatively flat harmonic spectrum at low frequencies. It is oftenrequired to generate waveforms with a duty cycle variable from 40% to60% to test the operation of equipment inputs which must continue tooperate with variations from a nominal 50% duty cycle.

In a further embodiment of the invention, FIG. 9, the accumulator 81 isfollowed by an offset subtractor 91. In the first embodiment, the twoevents per cycle that defined transitions were the positive going andthe negative going transitions of the MSB. These events, by theirnature, define a 50% duty cycle. The effect of the subtractor is todefine a second point in the cycle which can be used to signal atransition. Now, the signals for the two output transitions are atransition on the MSB of the accumulator value 83, and a transition onthe MSB of the offset accumulator value 92.

A transition detector 93 monitors the MSB of each value. The hardwarewill not be set to produce two transitions which overlap, the scalingand transition computing hardware may therefore be shared by bothtransition events, using the multiplexer 94 to choose the correct numberthat represents the residue following the signalled transition.

The direction of the output transition is now signalled by whichtransition event caused the transition, rather than the polarity of theaccumulator MSB.

In a further embodiment of the invention, FIG. 10, the calculating meansis replaced by a lookup table 101, which stores a number of precomputedtransition waveforms, each of which represents a transition having adifferent effective delay time. Three of such waveforms are shown inFIG. 6. Typically many more waveforms will be stored, for instance 64.It is now the function of the sequencer to select the waveform havingthe nearest delay to that output by the divider, and to sequence thiswaveform onto the output.

In the previous embodiment, the calculation means could work to as muchprecision as was produced by the phase accumulator. However, the numberof address bits used to select a waveform from the LUT will typically bemany fewer than produced by the phase accumulator. The wide word fromthe accumulator must be reduced to the same width as the address word bytruncation or rounding.

In applications where real time modulation is not necessary, the phaseincrement will remain fixed for long periods of time. In this case it ismore efficient to implement the scaling function by computing thereciprocal of the phase increment once when the output frequency is setup, and then to multiply the residual by this factor rather than usingdivision. In applications where the frequency of the square wave isrequired to be modulated in real time, then the value of phase incrementwill be changed in real time, and the scaler must be implemented by realtime division.

A normal lookup table DDS is well known in the art. As an alternative tocomputation of the transition times of a square wave, it may be thoughtpossible to store a complete cycle of a filtered output waveform in alookup table which maps waveform phase to waveform voltage. However,this can easily be seen to be impractical. Consider a 1 Hz waveform thatmust be produced from a signal generator having a 100 MHz clock. The LUTwill be required to store 100M samples. Efficiencies such as symmetrycould be employed to reduce the number by a factor of two or four, buteven 25M samples is not a practical table size. Another unique curvewill be required for each duty cycle ratio that is required to beproduced.

A further embodiment of the invention seeks to address the problem bynoting that the waveform well away from the transitions contains noinformation, that is it is a consistent high or low. It is only in thevicinity of the transitions that the non-trivial samples are required tobe stored in the LUT.

Accordingly, a non-linear mapping is used between the phase accumulatorand the LUT, as shown in FIG. 11. The relationship between the numericalvalues on the ports of the components of FIG. 11 is shown in the graphin FIG. 12. All numbers are interpreted as having values 0 to 1. Thevalue of the phase word 83 from the accumulator is represented on the xaxis 121. Similarly the axis 122 shows the value of the non-linearlymapped phase 112, and axis 123 shows the value of the LUT output 113,which is also the output from the invention.

The phase word 83 is divided into four regions, named according to theoutput produced from the LUT. These are steady high 124, low going 125,steady low 126, and high going 127. The boundaries are defined in termsof phase. If the boundaries maintain their phase value while thefrequency of the square wave generator is varied, then the time durationof the transition regions will vary correspondingly. As the idealduration of the transition is the minimum consistent with the spectralperformance required, it is appropriate to reset the transitionboundaries as a function of the generator frequency whenever changingthat frequency, to maintain the transition duration constant at thisminimum. It will be obvious that if a very high frequency waveform isbeing generated, a significant fraction of the whole cycle will bedevoted to the transition, whereas for a low frequency square wave, onlya small fraction of the cycle will be used.

The function of each part of the non-linear mapping will now bedescribed with reference to FIG. 12. All input phases that fall in thesteady high part of the cycle 124 map to a single output, which whenapplied to the LUT following, produce the maximum output from the LUT.The input phases that fall in the low going region 125 are mappedlinearly onto the LUT inputs that produce the low going half cycle. Asthe phase from the accumulator progresses through this region, the LUTproduces outputs which follow the stored waveform down. The mappings forthe steady low region and the high going region are equivalent to andinverted from the previous mappings described.

There is a choice of waveforms for the LUT 113. FIG. 12 shows curveswhich are generated using a sinewave LUT. This would be advantageous ina versatile test instrument, as the LUT may be the same one that isnormally employed when sine wave output is required, or be implementedas a COORDIC algorithm. Whereas use of a sine wave transition gives avery significant improvement over the performance of the prior artgenerator, other waveforms, such as an integrated Gaussian, are evenbetter.

The LUT of FIG. 12 and the LUT for 1 Hz are different sizes, and havedifferent contents. It would be necessary to have a very large RAM basedtable, rather than ROM, which was re-written at every change offrequency, that or the necessity to have a different table for eachfrequency. Either of those would be very expensive. The non-linear phasemapping does two things. It allows a small table, or COORDIC algorithm,which encodes only the rising and falling portions of FIG. 12, to do thejob of the whole curve of FIG. 12. It also allows one small table to beused for any frequency, by changing the mapping, rather than changingthe contents of the table.

The mechanism required to produce the non-linear mapping is shownconceptually in FIG. 13. Four subtractors 131 are used to compare theinput phase with the boundaries of the mapping regions 128. When theoutput of the subtractor is positive, the input phase is less than therespective boundary. By comparing which of the subtractor outputs arepositive and which negative, which may be done by observing the MSB ofeach number only, the control block 132 can determine in which regionthe input phase lies. It then drives the multiplexer 133 to select thefixed values of 0 for region 124, and 0.5 for region 126. The regionsthat are linearly mapped are obtained by using the weighted sum of thedistance of the input phase from both boundaries. The weighting isapplied using multipliers 134 and summers 135. The appropriate output isselected in the multiplexer 133.

FIG. 13 is a conceptual implementation which shows all the operationsrequired for a general mapping. The practical implementation of FIG. 14has removed all of the operations that are redundant in FIG. 13, whenthe savings inherent in using 0 and 0.5 as the fixed outputs arerealised.

It will be apparent that the two multipliers are never requiredsimultaneously in FIG. 14, and so a further simple rearrangement ispossible to multiplex one multiplier to serve both duties, under controlof the control block 132.

FIG. 14 is still more general than may be required. In particular, theboundaries A, B and C are all able to be moved to any general positionin the cycle. If each boundary position is restricted to lie onmultiples of 2^(n), then the further hardware simplification of FIG. 15becomes possible. Instead of comparing the accumulator phase across thewhole word width of the phase word, it needs only be compared with thetop few bits. This is because the restriction to boundaries on 2^(n)boundaries forces all of the lower bits to zero on the boundaries.

It will be appreciated that restricting the transition duration topowers of 2 will prevent the length of the transition waveform beingheld constant as the period of the square wave is changed. The best thatmay be done is to choose a length that falls within a range of 2, forinstance keeping the transition length at 8 or more samples, and lessthan 16 samples. If the application can tolerate this variation inwaveform shape with frequency, then the hardware saving of FIG. 15 overFIG. 14 may be useful.

In an illustrative example, the compare block in FIG. 15 may be set upto operate as in table 2. Under these circumstances, it would producethe waveforms shown in FIG. 12. This example is written for n=3, thoughthe generalisation to any value of n will be apparent to one skilled inthe art. The top n MSBs are examined, and a decision is made as to whichregion the phase is in. TABLE 2 Value of phase word 3 MSBs Region 000,001 High 010 Low going 011, 100, 101, 110 Low 111 High going

In the low going and high going regions, the input phase, which covers⅛^(th) of a cycle in this example, must be scaled to cover ½ cycle atthe LUT. This is achieved by a left shift of 2 bit positions, or n−1 bitpositions in the general case. As the width of the region that involvesa scaling of the phase word is now restricted to 2^(n), it has beenpossible to replace general multiplier of FIG. 14 with a simple leftshift.

This example is for the general case where the duty cycle of thewaveform is not 50%. It will be appreciated that yet further savings inlogic complexity are possible in the special case of 50% duty cycle.

The fact that the boundaries must lie on multiples of 2^(n) not onlyrestricts the length of the transition regions as previously discussed,but also restricts choice of the length of high and low regions, andhence duty cycle achievable. For reasonably small 2^(n), for instancen−7, a resolution of better than 1% is possible for the duty cycle.

1. A waveform generator for generating a data stream comprising aplurality of data values at predetermined sample times, the data streambeing representative of a smooth version of an original waveform, theoriginal waveform including at least one abrupt transition, the waveformgenerator comprising: a phase accumulator arranged to provide an outputrepresentative of the phase of the original waveform, the accumulatoroutput being sequentially incremented by a predetermined increment valueat successive sample times; a transition detector arranged to receivethe accumulator output and to provide an output signal when theaccumulator output is at least equal to a value representative of thephase of the original waveform at the point of an abrupt transition; aphase scaler arranged, in response to receiving the output signal fromthe transition detector, to determine from the accumulator output thedifference between the phase represented by the accumulator output andthe phase of the original waveform at the point of the abrupt transitionand to convert the phase difference to a time value; a data processorarranged to generate a sequence of data values representative of asmooth transition offset by the time value from the sample times; and asequencer arranged to insert said sequence of data values into said datastream.
 2. A waveform generator according to claim 1, wherein the dataprocessor is arranged to calculate the sequence of data valuesrepresentative of the smooth transition in accordance with the timevalue output from the phase scaler.
 3. A waveform generator according toclaim 1, further comprising a data storage device having a plurality ofpredetermined sequences of data values stored thereon, eachpredetermined sequence of data values being representative of a smoothtransition offset by a particular value of the time value output fromthe phase scaler, the data processor being arranged to select thepredetermined sequence of data values corresponding to a particular timevalue that is closest in value to the time value output from the phaseselector.
 4. A waveform generator according to claim 1, furthercomprising an offset generator arranged to receive the output from thephase accumulator, to sum the output value with a predetermined offsetvalue and to provide the product of the summation to the transitiondetector, wherein the transition detector provides a further outputsignal representative of a further abrupt transition.
 5. A waveformgenerator according to claim 1, wherein said predetermined incrementvalue is variable.
 6. A waveform generator according to claim 1, whereinthe smooth transition corresponds substantially to a gaussian pulseresponse convolved with a square wave.
 7. A method of generating awaveform, the waveform comprising a plurality of data values atpredetermined sample times, the waveform being a smooth representationof an original waveform, the original waveform including at least oneabrupt transition, the method comprising: incrementing a phaseaccumulator by a predetermined increment value at successive sampletimes and providing an output from the phase accumulator, the outputbeing representative of the phase of the original waveform; determiningwhen the phase accumulator output is at least equal to a valuerepresentative of the phase of the original waveform at the point of anabrupt transition; determining from the phase accumulator output at thepoint of an abrupt transition the phase difference between the phaserepresented by the phase accumulator output and the phase of theoriginal waveform at the point of the abrupt transition and convertingthe phase difference to an offset time value; generating a sequence ofdata values representative of a smooth transition offset by theconverted time value from the sample times; and inserting the generatedsequence of data values into the plurality of data values comprising thegenerated waveform.
 8. A method according to claim 7, wherein thesequence of data values representative of the smooth transition arecalculated mathematically in accordance with the offset time value.
 9. Amethod according to claim 7, wherein the sequence of data valuesrepresentative of the smooth transition is selected from a plurality ofstored sequences.
 10. A method according to claim 7, wherein the methodfurther comprises summing an offset value with the output of the phaseaccumulator and determining when the summed product is at least equal toa value representative of the phase of the original waveform at thepoint; of a further abrupt transition.
 11. A method according to claim7, wherein the smooth transition corresponds substantially to a gaussianpulse response convolved with a square wave.
 12. A method according toclaim 7, wherein the value by which the phase accumulator is incrementedis variable.
 13. A waveform generator for generating a sequence of datavalues at predetermined time intervals, the sequence of data valuesbeing representative of a smooth version of an original waveform, theoriginal waveform comprising periods of constant amplitude separated byabrupt transitions, the waveform generator comprising: a phaseaccumulator arranged to provide an accumulator output the value of whichis incremented by a predetermined value at each predetermined timeinterval, the accumulator output being representative of the phase ofthe original Waveform; a phase mapper arranged to receive theaccumulator output and to generate a modified phase output in accordancewith the received accumulator output; and an output generator arrangedto output a data value of said sequence of data values in accordancewith the modified phase output received from the phase mapper.
 14. Awaveform generator according to claim 13, wherein the output generatorcomprises a look-up table having a plurality of predetermined datavalues each corresponding to a modified phase output value.
 15. Awaveform generator according to claim 13, wherein the phase mappergenerates a constant modified phase output when the accumulator outputis representative of a period of the original waveform having a constantamplitude and wherein said constant modified phase output corresponds toa single data value in the look-up table.
 16. A waveform generatoraccording to claim 13, where the phase mapper comprises comparator meansfor comparing the accumulator output with one or more predeterminedthreshold values, the or each threshold value defining the boundarybetween said periods of constant amplitude in the original waveform. 17.A method of generating a sequence of data values at predetermined timeintervals, the sequence of data values being representative of a smoothversion of an original waveform, the original waveform comprisingperiods of constant amplitude separated by abrupt transitions, themethod comprising: incrementing a phase accumulator by a predeterminedvalue of successive time intervals and providing an accumulator outputthat is representative of the phase of the original waveform; modifyingthe accumulator output as a function of the accumulator output togenerate a modified phase output; and generating a data value comprisingone of the data values of the sequence of data values in accordance withthe modified phase output.
 18. A method according to claim 17, whereinthe generated data value is derived from a look-up table having aplurality of data values each corresponding to a modified phase outputvalue.
 19. A method according to claim 18, wherein the modified phaseoutput is a constant value when the accumulator output is representativeof a period of the original waveform having a constant amplitude andsaid constant value corresponds to a single data value in the look-uptable.
 20. A method according to claim 17, the method further comprisingcomparing the accumulator output with one or more predeterminedthreshold values, the or each threshold value corresponding to aboundary between the periods of constant amplitude in the originalwaveform.